package com.zp.ojcodesandbox.Security;

import java.io.FileDescriptor;
import java.security.Permission;

/**
 * 安全管理
 */
public class MySecurityManager extends SecurityManager {
    @Override
    public void checkPermission(Permission perm) {
 //       super.checkPermission(perm);
    }

    // 不允许
    @Override
    public void checkRead(String fd) {
        throw new SecurityException("checkRead 权限异常" + fd);
    }

    @Override
    public void checkExec(String cmd) {
        throw new SecurityException("checkExec 权限异常" + cmd);
    }

    @Override
    public void checkWrite(String file) {
        throw new SecurityException("checkWrite 权限异常" + file);
    }

    @Override
    public void checkConnect(String host, int port) {
        throw new SecurityException("checkConnect 权限异常" + host + ":" + port);
    }
}
